Skip to content

Instantly share code, notes, and snippets.

@Jontes-Tech
Created March 23, 2022 16:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Jontes-Tech/7934b9f1f35c6dd9f3fe003d9dc88410 to your computer and use it in GitHub Desktop.
Save Jontes-Tech/7934b9f1f35c6dd9f3fe003d9dc88410 to your computer and use it in GitHub Desktop.
FoxBot Source code
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