Skip to content
/ ye-bot Public

A discord bot that fetches random Kanye's tweets! We do a little bit of trolling 😎

Notifications You must be signed in to change notification settings

armeetj/ye-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

YeBot 😎

@armeetjatyani 2021 JDA discord-bot A discord bot that tweets Kanye's tweets every 6 hours!

Description

  • by this point I had made some basic discord bots with discord.js (JavaScript) and discordpy (Python)
  • I wanted to try out JDA (Java Discord API)
  • Made a simple meme bot, that responds to the !ye command with a random Kanye tweet!

Demo

image
image

Full Demo: https://youtu.be/7V1mJanghhc

Code Snippets

.../java/api/KanyeRestAPIWrapper.java

/**
 * https://api.kanye.rest
 * @return
 */
@SneakyThrows
public static String get()
{
    OkHttpClient client = new OkHttpClient();
    Request request = new Request.Builder()
            .url("https://api.kanye.rest?format=text")
            .build(); // defaults to GET

    Response response = client.newCall(request).execute();
    return response.body().string();
}

.../java/YeBot.java

public class YeBot
{
    public static String yeToken;

    @SneakyThrows
    public static void main(String[] args)
    {
        // get discord bot token
        yeToken = System.getenv("YEBOT_TOKEN");
        System.out.println("TOKEN: " + yeToken);
        if(yeToken.length() == 0) System.exit(1);

        JDABuilder builder = JDABuilder.createDefault(yeToken)
                .addEventListeners(
                        new MainListener()

                );

        builder.build();

    }
}

About

A discord bot that fetches random Kanye's tweets! We do a little bit of trolling 😎

Topics

Resources

Stars

Watchers

Forks

Languages