Skip to content

Instantly share code, notes, and snippets.

View Glitchii's full-sized avatar
:shipit:
Salut 👋

Ed Glitchii

:shipit:
Salut 👋
View GitHub Profile
@Glitchii
Glitchii / login.php
Created May 1, 2023 16:02
Login with Google - PHP
<?php
require __DIR__ . '/../vendor/autoload.php';
try {
$error = null;
$googleClientId = 'YOUR_GOOGLE_CLIENT_ID';
$userData = [];
if (isset($_POST['credential'], $_POST['g_csrf_token'])) {
@Glitchii
Glitchii / custom_commands.py
Created March 27, 2020 16:16 — forked from Phxntxm/custom_commands.py
A pretty simplified way to implement custom commands into your bot.
from discord.ext import commands
# The check to ensure this is the guild used where the command was made
def guild_check(_custom_commands):
async def predicate(ctx):
return _custom_commands.get(ctx.command.qualified_name) and ctx.guild.id in _custom_commands.get(ctx.command.qualified_name)
return commands.check(predicate)
class CustomCommands(commands.Cog):