gpt-3.5-turbo-0613· OpenAI
WildChat-4.8M (AI2)
discord.js example
- User
discord.js example
- Assistant
Here is an example of a simple Discord bot using discord.js:
const Discord = require('discord.js'); const client = new Discord.Client(); // When the bot is ready and logged in client.once('ready', () => { console.log('Bot is ready!'); }); // When a message is sent in a server client.on('message', message => { // Ignore messages sent by the bot itself if (message.author.bot) return; // Check if the message starts with the prefix if (message.content.startsWith('!')) { // Get the command and arguments const [command, ...args] = message.content.slice(1).split(' '); // Handle different commands if (command === 'hello') { message.channel.send('Hello, world!'); } else if (command === 'ping') { message.channel.send('Pong!'); } else if (command === 'say') { const text = args.join(' '); message.channel.send(text); } } }); // Log in to Discord with your app's token client.login('YOUR_DISCORD_TOKEN');This bot listens for messages in a server and checks if the message starts with the prefix "!" followed by a command. The available commands are "hello" which responds with "Hello, world!", "ping" which responds with "Pong!", and "say" which repeats the text given after the command.
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.