A simple flutter package to send message to discord channel via discord bot
To use this plugin, add discord_logger
as a dependency in your pubspec.yaml file 🔗.
-
Create New Application in 🔗 https://discord.com/developers/applications.
-
Go to OAuth2 in menu and go to Url Generator
-
Select
applications.commands
andbot
in the form -
For now, give Administrator Permissions in Bot Permissions
-
Copy the Generated Url and Paste in your browser's new tab
-
Add the server you want to access to send Messages(for now) and complete the process
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
DiscordLogger(
channelId: "[Add Your Channel Id]",
botToken: "[Add Your Bot Token]",
);
return MaterialApp(
...
);
}
}
-
Go to https://discord.com/developers/applications and select the application
-
Go to Bot Section in menu
-
Add a New Bot
- Reset Token To get the Token
- Copy the token and add to the botToken parameter
final discord = DiscordLogger.instance;
...
discord.sendMessage("This is a error log to my channel");
...
...
List messages = [];
var response = await discord.getChannelMessages();
setState((){
messages = response;
});
...
...
discord.updateChannelMessage(messageId: "123", message: "This is an updated message");
...
...
discord.deleteChannelMessage(messageId: "123");
...
Any new Contributors are welcomed.
Feel Free to request any missing features or report issues here 🔗.