Code Monkey home page Code Monkey logo

twitchbot's Issues

Grab Specific Quote Via Index

Get list of quotes in order of index from database and refer to the order given in memory. Use something like: !quote 1 to grab the first quote even thought the database index could be at 1002.

When grabbing the range of indexes, display that for the user so they know what is valid to grab.
Also, when displaying the quote, show the index assigned to it and get the user who quoted it.

MultiTwitch Link Generator

This should be a command that allows the broadcaster to generate a link to allow people to watch multiple streamers at the same time. This link uses a separate service like multitwitch.tv to provide the feed on a separate tab.

The purpose of this command will allow multiple streamers to "co-stream"
Example: http://multitwitch.tv/broadcaster/username2/username3/username4

Here are the commands for this feature:

!addmultitwitch [username2] [username3] [username4] (broadcaster only)

  • This commmand will require one parameter (with 3 optional parameters)
  • This should append users to the link if not all of the parameters were filled
  • 4 user limit for now...

!resetmultitwitch (broadcaster only)

  • Resets the link to only have the broadcaster attached to the link

!multitwitch (general chat)

  • Display multitwitch link to the chat if there are other users appended to the link

Personal Follow via Twitter

Let interested users know when the broadcaster is streaming a certain game that they prefer.

Channel owner makes a list of games they play and users can select which ones to be notified.

Remove UNIQUE attribute on Username column for Broadcasters table

Need to remove uniqueness because of this scenario:

Let's say we have two broadcasters A & B. Broadcaster A decided to change their name to Broadcaster C, but doesn't log back into the bot. After X amount of time passes, Broadcaster B changes their name to Broadcaster A. Now the new broadcaster A can't be added to this table because the old broadcaster A never logged back into the bot to notify the database of the name change.

Countdown

Implement a countdown system a moderator and above would use to display when something is going to happen. At the moment, only hold one countdown at a time until command is well tested.

Make a countdown:
!makecountdown "Happy New Year's" "1-1-2016 12:00:00 AM"

Display the countdown:
!displaycountdown
Countdown to Happy New Year's: 28 days, 7 hours, 33 minutes, and 42 seconds

Blackjack

Make a Blackjack mini game with user's current funds

!top3rank

Display the 3 highest ranking followers underneath a streamer

Delete expired reminders

This will allow users to set an end date and time for reminders if a re-occurring event only lasts for X amount of time

!gamble all

Let user gamble away all of their currency

Auto Publish Tweets on Channel Info Change

Each time either !updatetitle or !updategame is used, make an option to tweet the changes made to the channel.

Make a boolean so it can be shared to both update commands inside the main function.

bool autoTweetChanges = true;

Mods Giving Currency To Each Other

Don't allow moderators (bot or channel) to give each other currency via !deposit and !bonusall

Use _modInstance.Moderators list to check alongside _twitchChatterListInstance.ChattersByType

!usage [cmd]

Help explain a command in-chat

Example Input: !usage sr
Example Output: The song request command is "!sr [artist] - [title]". It allows users to request songs to the broadcaster so they are aware what the viewers want to listen to.

Return NotFound() With Content Message

Example: return NotFound("Warning: Chat bot cannot find [insert subject here]");
But be sure to include any Console.WriteLine(""); to immediately tell the user it has been loaded

!top3[currency name]

Display the people under the current broadcaster who have the most amount of streamer currency

Handle !currentsong using IF and ELSE

Rewrite command with this code:

StatusResponse status = spotify.GetStatus();
if (status != null) 
{
    irc.sendPublicChatMessage("Current Song: " + status.Track.TrackResource.Name
        + " || Artist: " + status.Track.ArtistResource.Name
        + " || Album: " + status.Track.AlbumResource.Name);
}
else
    irc.sendPublicChatMessage("The broadcaster is not playing a song at the moment");

This will handle the situation where Spotify is not playing anything

Get Current Song

In chat, get current song info like !currentsong

StatusResponse status = spotify.GetStatus();
if (status == null) return;

if (message.Contains("!currentsong")) 
    spotifyCtrl.ShowUpdatedTrack(status.Track, false);

Custom Commands

Will create a separate branch and update this task list accordingly

  • Create database tables
CREATE SCHEMA Cmd;
GO

-- Pre-defined commands made by developer(s)
CREATE TABLE Cmd.PermissionLevel
(
    Id INT IDENTITY(1, 1) NOT NULL
  , PermissionName VARCHAR(20) NOT NULL
  , CONSTRAINT PK_Cmd_PermissionLevel
        PRIMARY KEY (Id)
);
CREATE TABLE Cmd.Method
(
    Id INT IDENTITY(1, 1) NOT NULL
  , MethodName VARCHAR(10) NOT NULL
  , CONSTRAINT PK_Cmd_Method
        PRIMARY KEY (Id)
);
CREATE TABLE Cmd.PredefinedCommand
(
    Id INT IDENTITY(1, 1) NOT NULL
  , Command VARCHAR(30) NOT NULL
  , MethodId INT NOT NULL
        FOREIGN KEY REFERENCES Cmd.Method (Id)
  , CONSTRAINT PK_Cmd_PredefinedCommand
        PRIMARY KEY CLUSTERED (Id)
);
CREATE TABLE Cmd.UserSetPredefinedCommand
(
    Id INT IDENTITY(1, 1) NOT NULL
  , MethodId INT NOT NULL
        FOREIGN KEY REFERENCES Cmd.Method (Id)
  , BroadcasterId INT NOT NULL
        FOREIGN KEY REFERENCES dbo.Broadcaster (Id)
  , PermissionId INT NOT NULL
        FOREIGN KEY REFERENCES Cmd.PermissionLevel (Id)
  , CONSTRAINT PK_Cmd_UserSetPredefinedCommand
        PRIMARY KEY (Id)
);

-- Custom commands
CREATE TABLE Cmd.CustomCommand
(
    Id INT IDENTITY(1, 1) NOT NULL
  , Command NVARCHAR(30) NOT NULL
  , Message NVARCHAR(500) NOT NULL
  , BroadcasterId INT NOT NULL
        FOREIGN KEY REFERENCES dbo.Broadcaster (Id)
  , PermissionId INT NOT NULL
        FOREIGN KEY REFERENCES Cmd.PermissionLevel (Id)
  , CONSTRAINT PK_Cmd_CustomCommand
        PRIMARY KEY (Id)
);
  • Create Models and DTOs
public enum PermissionLevel
{
    Viewer,
    VIP,
    Subscriber,
    Moderator,
    Broadcaster
}

public sealed class ChatCommand
{
    private readonly string _name;
    public readonly CommandName Value;

    public ChatCommand(string name, CommandName value)
    {
        _name = name;
        Value = value
    }

    public override string ToString()
    {
        return _name;
    }

    public enum CommandName
    {
        Quote = 1,
        FollowSince = 2,
        FollowAge = 3,
        Rank = 4,
        // add more
    }

    public static readonly ChatCommand Quote = new ChatCommand("!quote", Value.Quote);
    public static readonly ChatCommand FollowSince = new ChatCommand("!followsince", Value.FollowSince );
    public static readonly ChatCommand FollowAge = new ChatCommand("!followage", Value.FollowAge );
    public static readonly ChatCommand Rank = new ChatCommand("!rank", Value.Rank );
    // add more
}

Look into this StackOverflow answer as a reference for the sealed class ChatCommand

  • Re-write giant if block in TwitchBotApplication.cs to use custom commands with user-set permissions

...will write more later

Use similar logic from FollowSince with SubscribeSince

Add manual check if chatter listener doesn't have the user requesting this info.
Reference to CmdFollowSince()

TwitchChatter chatter = _twitchChatterListInstance.TwitchFollowers.FirstOrDefault(c => c.Username.Equals(username));

if (chatter == null)
{
    // get chatter info manually
    RootUserJSON rootUserJSON = await _twitchInfo.GetUsersByLoginName(username);

    using (HttpResponseMessage message = await _twitchInfo.CheckFollowerStatus(rootUserJSON.Users.First().Id))
    {
        string body = await message.Content.ReadAsStringAsync();
        FollowerJSON response = JsonConvert.DeserializeObject<FollowerJSON>(body);

        if (!string.IsNullOrEmpty(response.CreatedAt))
            chatter = new TwitchChatter { Username = username, CreatedAt = Convert.ToDateTime(response.CreatedAt) };
    }
}

// mainly used if chatter was originally null
if (chatter != null)
{
    DateTime startedFollowing = Convert.ToDateTime(chatter.CreatedAt);
    _irc.SendPublicChatMessage($"@{username} has been following since {startedFollowing.ToLongDateString()}");
}
else
{
    _irc.SendPublicChatMessage($"{username} is not following {_botConfig.Broadcaster.ToLower()}");
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.