Created
March 23, 2022 16:09
-
-
Save Jontes-Tech/7934b9f1f35c6dd9f3fe003d9dc88410 to your computer and use it in GitHub Desktop.
FoxBot Source code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import discord | |
import random | |
class MyClient(discord.Client): | |
async def on_ready(self): | |
print('Logged on as', self.user) | |
async def on_message(self, message): | |
# don't respond to ourselves | |
if message.author == self.user: | |
return | |
if message.content == 'pic': | |
img = random.randrange(1,123) | |
await message.channel.send('https://randomfox.ca/?i={}'.format(img)) | |
if message.content == 'credits': | |
await message.channel.send('Bot with images "loaned" from xinitrc - randomfox.ca, bot run and hosted by Jonte') | |
if message.content == 'source': | |
await message.channel.send('Click here for source code: https://github.com/Jontes-Tech/fox-bot/') | |
client = MyClient() | |
client.run('Token here please') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment