Skip to content

Instantly share code, notes, and snippets.

View Soheab's full-sized avatar
📚

Soheab Soheab

📚
  • 20:48 (UTC +02:00)
View GitHub Profile
@Soheab
Soheab / clown 🤡.py
Created January 15, 2020 20:30
clown.
self.guild_detect = [336642139381301249]
self.channel_detect = [381963689470984203]
self.detect = []
self.lol = []
self.user_mes = []
@commands.Cog.listener()
async def on_message(self, message):
if message.author.bot:
return
@Soheab
Soheab / bikeshedding.md
Last active September 27, 2020 16:40
See here topics that are already discussed in the bikeshedding channel on the discord.py server.

This list is not in any order, older topics can be above newer ones.

Made by Soheab#6240
This gist probably won't be updated anymore.

Total topics here: 46

TIP :: You can use Ctrl + F (or Cmd + F on Mac) to search through this.


Sparkly Changelog =====

This page keeps a detailed human friendly rendering of what's new and changed in specific versions for v2.1+.

If you want the be notified of any update, you can join my Support Server. --------

@Soheab
Soheab / supported_google_translate_languages.md
Last active May 2, 2022 11:40
See here all supported languages and their code that Google Translate supports.

Supported Google Translate Languages

⭐ Star if this is helpful to you. source

Afrikaans - af Irish -ga Albanian - sq Italian - it Arabic - ar Japanese - ja
Azerbaijani - az Kannada - kn Basque - eu Korean - ko Bengali - bn Latin - la
Belarusian - be Latvian - lv Bulgarian - bg Lithuanian - lt Catalan - ca Macedonian - mk
Malay - ms Maltese - mt Croatian - hr Norwegian - no Czech - cs Persian - fa
Danish - da Polish - pl Dutch - nl Portuguese - pt English - en Romanian - ro
@Soheab
Soheab / complete..md
Last active October 20, 2022 09:35
See here a custom check for all types of commands that can be used to check if user has any permissions you pass

See here the "complete" check

"complete" as in it supports app and text commands and has some comments explaining the code. As you may have noticed, there are multiple files in this gist:

Text Cmmands Only Here

Complete

See here the complete check with support for app and text commands:

@Soheab
Soheab / supported_google_translate_languages.md
Created May 30, 2021 18:05
See here all supported languages and their code that Google Translate supports.

Support Google Translate Languages

⭐ Star if this is helpful to you.

Afrikaans - af

Irish -ga

Albanian - sq

Italian - it

Arabic - ar

Japanese - ja

Azerbaijani - az

# for testing:
# import collections
# emoji = collections.namedtuple("emo", ["animated"])(False)
emoji = ... # some (Partial)Emoji object
guild = ... # some Guild object
emojis = guild.emojis
total = len(guild.emojis)
limit = guild.emoji_limit
animated = sum(1 for e in emojis if e.animated)
@Soheab
Soheab / wait_for in command.md
Last active July 11, 2023 16:56
Examples for a wait_for in ext.commands.

This gist shows how to make the bot wait for a message or reaction after doing a command. This should not be copypasted.

Docs

Check the discord.py docs for a detailed explanation of how it all works internally and which kwargs it takes.

Commands

See here two commands, one waiting for any message in a channel and the other waiting for a reaction with a specific emoji.

Check

@Soheab
Soheab / markdown.md
Last active August 10, 2023 21:51
See here the progress of the discord.py library after discontinuation.

The hyperlinks are either links to a gist or discord message in the discord.py server

  • Danny reworks async stuff, breaking changes for all!
@Soheab
Soheab / self_bot.md
Last active October 7, 2023 21:03
Read here how "self.bot" works in a discord.py cog. For a tag called `?tag self.bot` on the dpy server.

What is self.bot and how does it work?

TLDR: it's a custom attribute which you define.

self = class instance bot = attribute that's usually assigned to the bot instance given in an extension's setup function.

Basically:

class MyCog(Cog):
    # this function is called when we do MyCog()