如何在discord.py中删除我自己的消息?

时间:2020-04-08 06:14:20

标签: python discord discord.py

我正在尝试为一个人添加一个角色,我已经做了,但也想在此之后立即删除该消息。我对如何删除邮件有任何想法吗?

function initializeSession() {
  var session = OT.initSession(apiKey, sessionId);

  session.on('streamCreated', function streamCreated(event) {



    var subscriberOptions = {
      insertMode: 'append',
      width: '100%',
      height: '100%'
    };
    session.subscribe(event.stream, 'subscriber', subscriberOptions, handleError);
  });

  session.on('sessionDisconnected', function sessionDisconnected(event) {
    console.log('You were disconnected from the session.', event.reason);
  });


  var publisherOptions = {
    insertMode: 'append',
    width: '100%',
    height: '100%',
    name: pubname,
    style: { nameDisplayMode: "auto" }
  };
  var publisher = OT.initPublisher('publisher', publisherOptions, handleError);

  session.connect(token, function callback(error) {
    if (error) {
      handleError(error);
    } else {
      session.publish(publisher, handleError);
    }
  });
}

getData();
initializeSession();

1 个答案:

答案 0 :(得分:1)

从上下文中获得的消息可以称为:

await ctx.message.delete()