Skip to content

Instantly share code, notes, and snippets.

@redtrillix
Last active December 6, 2022 02:54
Show Gist options
  • Save redtrillix/3df6bdfcd0b1094abf6a2eb09593857c to your computer and use it in GitHub Desktop.
Save redtrillix/3df6bdfcd0b1094abf6a2eb09593857c to your computer and use it in GitHub Desktop.
A discord bot generated using ChatGPT (https://chat.openai.com/chat)

A discord bot generated using ChatGPT. These are just tests so I dont recommend you use these in prod.

const Discord = require('discord.js');
const client = new Discord.Client();
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('pong');
}
});
client.login('your_bot_token_here');
import discord
from discord.ext import commands
client = commands.Bot(command_prefix='!')
@client.event
async def on_ready():
print('Bot is ready.')
@client.command()
async def play(ctx, url):
channel = ctx.message.author.voice.channel
voice = await channel.connect()
voice.play(discord.FFmpegPCMAudio(url))
client.run('your_bot_token_here')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment